<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>跑马灯</title>
  <script src="./vue-2.4.0.js"></script>
</head>
<body>
<div id="app">
  <button @click="log1" :disabled="disd">浪起来</button>
  <button @click="log2" :disabled="!disd">风紧，扯呼</button>
  <p>{{msg}}</p>
</div>
</body>
<script>
  let vm = new Vue({
    el: '#app',
    data: {
      msg: '浪起来，风紧，扯呼~~~~~~~~',
      disd: false,
      tiemr: null,
    },
    methods: {
      log1() {
        this.disd = true;
        tiemr = setInterval( () => {
          this.msg = this.msg.slice(1) + this.msg.slice(0, 1);
        }, 200)
      },
      log2() {
        this.disd = false;
        clearInterval(tiemr);
      },
    }
  })
</script>
</html>